package com.xls.future;

import android.app.Application;
import android.content.Intent;
import android.os.Build;
import android.util.Log;

import com.tencent.bugly.crashreport.CrashReport;
import com.xls.future.bmob.BmobUtil;
import com.xls.future.entity.GroupData;
import com.xls.future.utils.LogUtil;

import java.util.List;

import cn.bmob.v3.Bmob;
import cn.bmob.v3.update.BmobUpdateAgent;

/**
 * Created by Administrator on 2017/8/25.
 */

public class FutureApp extends Application {

    private static final String TAG ="FutureApp";

    private List<GroupData> groups;

    private static FutureApp inst = null;


    @Override
    public void onCreate() {
        super.onCreate();

        Bmob.initialize(this, "c3a745217f5557ca28e64c8bb0302086");

        //查询所有分组数据
        BmobUtil.queryGroupCount(getApplicationContext());

        startService(new Intent(getApplicationContext(),MyService.class));

        CrashReport.initCrashReport(getApplicationContext(), "e4de9fdf30", true);

        LogUtil.d(TAG,"SDK_VERSION = "+ Build.VERSION.SDK_INT);
    }

    public static FutureApp getInst(){
        if(inst==null){
            inst = new FutureApp();
        }
        return inst;
    }

    public void setGroups(List<GroupData> groups) {
        this.groups = groups;
        Log.d("home","groups = "+groups.toString());
    }

    public List<GroupData> getGroups() {
        return groups;
    }
}
